import request from '@/utils/request'
export default{
  saveCourseInfo(courseInfo) {
    return request({
      url: '/admin/edu/course/save-course-info',
      method: 'POST',
      data: courseInfo
    })
  },
  getCourseInfoById(id) {
    return request({
      url: `/admin/edu/course/course-info/${id}`,
      method: 'get'
    })
  },
  update(courseInfo) {
    return request({
      url: '/admin/edu/course/update-course-info',
      method: 'put',
      data: courseInfo
    })
  },
  list(page, limit, searchObj) {
    return request({
      url: `/admin/edu/course/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  // 查询要发布的课程详情
  getCoursePublishInfo(courseId) {
    return request({
      url: `admin/edu/course/getCoursePublishInfo/${courseId}`,
      method: 'GET'
    })
  },
  // 发布课程
  publish(courseId) {
    return request({
      url: `/admin/edu/course/publish/${courseId}`,
      method: 'PUT'

    })
  }
}
